<template>
    <div>
        <div id="dplayer"></div>
    </div>
</template>

<script>
import DPlayer from 'dplayer'
export default {
    mounted() {
        const url = this.getQueryString('url')
        console.log(url)
        // eslint-disable-next-line no-unused-vars
        const dp = new DPlayer({
            container: document.getElementById('dplayer'),
            video: {
                url: url
            }
        })
    },
    methods: {
        getQueryString(name) {
            const str = window.location.href.split('?')[1].split('=')[1]
            return decodeURIComponent(str)
        }
    }
}
</script>

<style>
#dplayer {
    width: 100vw;
    height: 100vh;
}
</style>
